package com.example.datastreamdemo

import org.apache.flink.api.scala.DataSet
import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment
import org.apache.flink.streaming.api.scala._

object SourceDemo1 {
  def main(args: Array[String]): Unit = {
    val senv: StreamExecutionEnvironment = StreamExecutionEnvironment.getExecutionEnvironment

    val ds1: DataStream[String] = senv.fromElements("spark", "flink")
    ds1.print()

    val ds2: DataStream[(Int, String)] = senv.fromElements((1, "spark"), (2, "flink"))
    ds2.print()

    val df3: DataStream[String] = senv.fromCollection(Array("spark", "flink"))
    df3.print()

    val df4: DataStream[Long] = senv.generateSequence(1, 9)
    df4.print()

    senv.readTextFile("E:\\note\\flink-project\\temp\\supplier_data.csv").print()

    senv.execute()
  }
}
